Skip to content

Conversation

junlarsen
Copy link
Member

@junlarsen junlarsen commented Apr 1, 2025

This function was previously used to get a type to the protocol that
was used to bitcast the initializer of GenerateProtocol. This bitcast
has later been removed (thanks to opaque pointers), but the member was
left behind.

History:

Also technically part of #123569

This function was previously used to get a type to the protocol that
was used to bitcast the initializer of GenerateProtocol. This bitcast
has later been removed (thanks to opaque pointers), but the member was
left behind.

History:

- 020de32 used ExternalProtocolPtrTy
- 34ee69b removes the bitcast
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. labels Apr 1, 2025
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented Apr 1, 2025

@llvm/pr-subscribers-clang

Author: Mats Jun Larsen (junlarsen)

Changes

This function was previously used to get a type to the protocol that
was used to bitcast the initializer of GenerateProtocol. This bitcast
has later been removed (thanks to opaque pointers), but the member was
left behind.

History:


Full diff: https://github.com/llvm/llvm-project/pull/133870.diff

1 Files Affected:

  • (modified) clang/lib/CodeGen/CGObjCMac.cpp (+1-21)
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index 639c38e7c4555..026a8dc7d75ca 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -184,25 +184,6 @@ class ObjCCommonTypesHelper {
   /// SelectorPtrTy - LLVM type for selector handles (typeof(SEL))
   llvm::PointerType *SelectorPtrTy;
 
-private:
-  /// ProtocolPtrTy - LLVM type for external protocol handles
-  /// (typeof(Protocol))
-  llvm::Type *ExternalProtocolPtrTy;
-
-public:
-  llvm::Type *getExternalProtocolPtrTy() {
-    if (!ExternalProtocolPtrTy) {
-      // FIXME: It would be nice to unify this with the opaque type, so that the
-      // IR comes out a bit cleaner.
-      CodeGen::CodeGenTypes &Types = CGM.getTypes();
-      ASTContext &Ctx = CGM.getContext();
-      llvm::Type *T = Types.ConvertType(Ctx.getObjCProtoType());
-      ExternalProtocolPtrTy = llvm::PointerType::getUnqual(T);
-    }
-
-    return ExternalProtocolPtrTy;
-  }
-
   // SuperCTy - clang type for struct objc_super.
   QualType SuperCTy;
   // SuperPtrCTy - clang type for struct objc_super *.
@@ -5636,8 +5617,7 @@ CGObjCNonFragileABIMac::CGObjCNonFragileABIMac(CodeGen::CodeGenModule &cgm)
 /* *** */
 
 ObjCCommonTypesHelper::ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm)
-    : VMContext(cgm.getLLVMContext()), CGM(cgm),
-      ExternalProtocolPtrTy(nullptr) {
+    : VMContext(cgm.getLLVMContext()), CGM(cgm) {
   CodeGen::CodeGenTypes &Types = CGM.getTypes();
   ASTContext &Ctx = CGM.getContext();
   unsigned ProgramAS = CGM.getDataLayout().getProgramAddressSpace();

@llvmbot
Copy link
Member

llvmbot commented Apr 1, 2025

@llvm/pr-subscribers-clang-codegen

Author: Mats Jun Larsen (junlarsen)

Changes

This function was previously used to get a type to the protocol that
was used to bitcast the initializer of GenerateProtocol. This bitcast
has later been removed (thanks to opaque pointers), but the member was
left behind.

History:


Full diff: https://github.com/llvm/llvm-project/pull/133870.diff

1 Files Affected:

  • (modified) clang/lib/CodeGen/CGObjCMac.cpp (+1-21)
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index 639c38e7c4555..026a8dc7d75ca 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -184,25 +184,6 @@ class ObjCCommonTypesHelper {
   /// SelectorPtrTy - LLVM type for selector handles (typeof(SEL))
   llvm::PointerType *SelectorPtrTy;
 
-private:
-  /// ProtocolPtrTy - LLVM type for external protocol handles
-  /// (typeof(Protocol))
-  llvm::Type *ExternalProtocolPtrTy;
-
-public:
-  llvm::Type *getExternalProtocolPtrTy() {
-    if (!ExternalProtocolPtrTy) {
-      // FIXME: It would be nice to unify this with the opaque type, so that the
-      // IR comes out a bit cleaner.
-      CodeGen::CodeGenTypes &Types = CGM.getTypes();
-      ASTContext &Ctx = CGM.getContext();
-      llvm::Type *T = Types.ConvertType(Ctx.getObjCProtoType());
-      ExternalProtocolPtrTy = llvm::PointerType::getUnqual(T);
-    }
-
-    return ExternalProtocolPtrTy;
-  }
-
   // SuperCTy - clang type for struct objc_super.
   QualType SuperCTy;
   // SuperPtrCTy - clang type for struct objc_super *.
@@ -5636,8 +5617,7 @@ CGObjCNonFragileABIMac::CGObjCNonFragileABIMac(CodeGen::CodeGenModule &cgm)
 /* *** */
 
 ObjCCommonTypesHelper::ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm)
-    : VMContext(cgm.getLLVMContext()), CGM(cgm),
-      ExternalProtocolPtrTy(nullptr) {
+    : VMContext(cgm.getLLVMContext()), CGM(cgm) {
   CodeGen::CodeGenTypes &Types = CGM.getTypes();
   ASTContext &Ctx = CGM.getContext();
   unsigned ProgramAS = CGM.getDataLayout().getProgramAddressSpace();

@junlarsen junlarsen requested a review from nikic April 5, 2025 08:20
@junlarsen junlarsen merged commit a641910 into main Apr 5, 2025
14 checks passed
@junlarsen junlarsen deleted the users/junlarsen/_clang_cgobjc_remove_unused_externalprotocolptrty_nfc_ branch April 5, 2025 09:01
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 5, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve2-vla-2stage running on linaro-g4-02 while building clang at step 12 "ninja check 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/199/builds/2596

Here is the relevant piece of the build log for the reference
Step 12 (ninja check 2) failure: stage 2 checked (failure)
...
PASS: Flang :: Driver/override-triple.ll (24781 of 96615)
PASS: Flang :: Driver/fixed-line-length.f90 (24782 of 96615)
PASS: Flang :: Driver/print-effective-triple.f90 (24783 of 96615)
PASS: Flang :: Driver/parse-fir-error.ll (24784 of 96615)
PASS: Flang :: Driver/missing-arg.f90 (24785 of 96615)
PASS: Flang :: Driver/print-resource-dir.F90 (24786 of 96615)
PASS: Flang :: Driver/mlink-builtin-bc.f90 (24787 of 96615)
PASS: Flang :: Driver/phases.f90 (24788 of 96615)
PASS: Flang :: Driver/parse-ir-error.f95 (24789 of 96615)
UNRESOLVED: Flang :: Driver/slp-vectorize.ll (24790 of 96615)
******************** TEST 'Flang :: Driver/slp-vectorize.ll' FAILED ********************
Test has no 'RUN:' line
********************
PASS: Flang :: Driver/print-target-triple.f90 (24791 of 96615)
PASS: Flang :: Driver/predefined-macros-compiler-version.F90 (24792 of 96615)
PASS: Flang :: Driver/parse-error.ll (24793 of 96615)
PASS: Flang :: Driver/scanning-error.f95 (24794 of 96615)
PASS: Flang :: Driver/print-pipeline-passes.f90 (24795 of 96615)
PASS: Flang :: Driver/pthread.f90 (24796 of 96615)
PASS: Flang :: Driver/no-duplicate-main.f90 (24797 of 96615)
PASS: Flang :: Driver/std2018-wrong.f90 (24798 of 96615)
PASS: Flang :: Driver/supported-suffices/f03-suffix.f03 (24799 of 96615)
PASS: Flang :: Driver/pass-plugin-not-found.f90 (24800 of 96615)
PASS: Flang :: Driver/supported-suffices/f08-suffix.f08 (24801 of 96615)
PASS: Flang :: Driver/lto-flags.f90 (24802 of 96615)
PASS: DataFlowSanitizer-aarch64 :: pair.cpp (24803 of 96615)
PASS: Flang :: Driver/target-gpu-features.f90 (24804 of 96615)
PASS: Flang :: Driver/pp-fixed-form.f90 (24805 of 96615)
PASS: Clangd Unit Tests :: ./ClangdTests/76/81 (24806 of 96615)
PASS: Flang :: Driver/multiple-input-files.f90 (24807 of 96615)
PASS: Flang :: Driver/tco-code-gen-llvm.fir (24808 of 96615)
PASS: Flang :: Driver/mllvm.f90 (24809 of 96615)
PASS: Clangd Unit Tests :: ./ClangdTests/73/81 (24810 of 96615)
PASS: Flang :: Driver/q-unused-arguments.f90 (24811 of 96615)
PASS: Flang :: Driver/target.f90 (24812 of 96615)
PASS: Flang :: Driver/unsupported-vscale-max-min.f90 (24813 of 96615)
PASS: Flang :: Driver/input-from-stdin/input-from-stdin.f90 (24814 of 96615)
PASS: Flang :: Driver/unparse-with-modules.f90 (24815 of 96615)
PASS: Flang :: Driver/optimization-remark-invalid.f90 (24816 of 96615)
PASS: Flang :: Driver/target-machine-error.f90 (24817 of 96615)
PASS: Flang :: Driver/prescanner-diag.f90 (24818 of 96615)
PASS: Flang :: Driver/response-file.f90 (24819 of 96615)
PASS: Flang :: Driver/save-temps-use-module.f90 (24820 of 96615)
PASS: Flang :: Driver/optimization-remark-backend.f90 (24821 of 96615)
PASS: Flang :: Driver/underscoring.f90 (24822 of 96615)
PASS: Flang :: Driver/w-arg-unsupported.f90 (24823 of 96615)
PASS: Flang :: Driver/falias-analysis.f90 (24824 of 96615)
PASS: Flang :: Driver/target-cpu-features-invalid.f90 (24825 of 96615)
PASS: Flang :: Driver/fveclib.f90 (24826 of 96615)

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 5, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vla-2stage running on linaro-g3-01 while building clang at step 12 "ninja check 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/41/builds/5946

Here is the relevant piece of the build log for the reference
Step 12 (ninja check 2) failure: stage 2 checked (failure)
...
PASS: Flang :: Driver/predefined-macros-x86.f90 (25212 of 97660)
PASS: Flang :: Driver/print-effective-triple.f90 (25213 of 97660)
PASS: Flang :: Driver/implicit-none.f90 (25214 of 97660)
PASS: Flang :: Driver/bbc-openmp-version-macro.f90 (25215 of 97660)
PASS: Flang :: Driver/override-triple.ll (25216 of 97660)
PASS: Flang :: Driver/frepack-arrays-contiguity.f90 (25217 of 97660)
PASS: Flang :: Driver/phases.f90 (25218 of 97660)
PASS: Flang :: Driver/predefined-macros-compiler-version.F90 (25219 of 97660)
PASS: Flang :: Driver/print-resource-dir.F90 (25220 of 97660)
UNRESOLVED: Flang :: Driver/slp-vectorize.ll (25221 of 97660)
******************** TEST 'Flang :: Driver/slp-vectorize.ll' FAILED ********************
Test has no 'RUN:' line
********************
PASS: Flang :: Driver/print-pipeline-passes.f90 (25222 of 97660)
PASS: Flang :: Driver/parse-error.ll (25223 of 97660)
PASS: Flang :: Driver/parse-fir-error.ll (25224 of 97660)
PASS: Flang :: Driver/mlir-pass-pipeline.f90 (25225 of 97660)
PASS: Flang :: Driver/pthread.f90 (25226 of 97660)
PASS: Flang :: Driver/mlink-builtin-bc.f90 (25227 of 97660)
PASS: Clangd Unit Tests :: ./ClangdTests/80/81 (25228 of 97660)
PASS: Flang :: Driver/macro-def-undef.F90 (25229 of 97660)
PASS: Flang :: Driver/parse-ir-error.f95 (25230 of 97660)
PASS: Flang :: Driver/scanning-error.f95 (25231 of 97660)
PASS: Flang :: Driver/print-target-triple.f90 (25232 of 97660)
PASS: Flang :: Driver/include-header.f90 (25233 of 97660)
PASS: Flang :: Driver/pp-fixed-form.f90 (25234 of 97660)
PASS: Flang :: Driver/std2018-wrong.f90 (25235 of 97660)
PASS: Clangd Unit Tests :: ./ClangdTests/71/81 (25236 of 97660)
PASS: Flang :: Driver/linker-flags.f90 (25237 of 97660)
PASS: Flang :: Driver/supported-suffices/f03-suffix.f03 (25238 of 97660)
PASS: Flang :: Driver/missing-arg.f90 (25239 of 97660)
PASS: Flang :: Driver/config-file.f90 (25240 of 97660)
PASS: Flang :: Driver/fixed-line-length.f90 (25241 of 97660)
PASS: Flang :: Driver/tco-code-gen-llvm.fir (25242 of 97660)
PASS: Flang :: Driver/supported-suffices/f08-suffix.f08 (25243 of 97660)
PASS: Flang :: Driver/lto-bc.f90 (25244 of 97660)
PASS: Flang :: Driver/target-gpu-features.f90 (25245 of 97660)
PASS: Flang :: Driver/target.f90 (25246 of 97660)
PASS: Flang :: Driver/pass-plugin-not-found.f90 (25247 of 97660)
PASS: Flang :: Driver/multiple-input-files.f90 (25248 of 97660)
PASS: Clangd Unit Tests :: ./ClangdTests/68/81 (25249 of 97660)
PASS: Flang :: Driver/unsupported-vscale-max-min.f90 (25250 of 97660)
PASS: Flang :: Driver/q-unused-arguments.f90 (25251 of 97660)
PASS: Flang :: Driver/mllvm.f90 (25252 of 97660)
PASS: Flang :: Driver/lto-flags.f90 (25253 of 97660)
PASS: Flang :: Driver/unparse-with-modules.f90 (25254 of 97660)
PASS: DataFlowSanitizer-aarch64 :: pair.cpp (25255 of 97660)
PASS: Flang :: Driver/input-from-stdin/input-from-stdin.f90 (25256 of 97660)
PASS: Flang :: Driver/no-duplicate-main.f90 (25257 of 97660)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants